<template>
	<view class="diy-category-product">
		<!-- 列表平铺 -->
		<template v-if="productData.style.display == 'list'">
			<!-- 单列商品 -->
			<template v-if="productData.style.column == 1">
				<view style="padding: 20rpx;width: 100%" v-for="(product, index) in productData.list">
					<brand-item :item="product"></brand-item>
				</view>
			</template>
		</template>
	</view>
</template>

<script>
import brandItem from '../../../brand-item.vue'
export default {
	components: {
		'brand-item': brandItem
	},
	data() {
		return {};
	},
	props: ['productData'],
	created() {
	},
	methods: {
		scroll(e) {
		},
		/*跳转产品详情*/
		gotoDetail(e) {
			let url = '/pages/product/detail/detail?product_id=' + e;
			this.gotoPage(url);
		}
	}
};
</script>

<style>
.diy-category-product {
	padding: 0;
}

.diy-category-product .huaxianjia {
	text-decoration: line-through;
	color: #999;
	margin-left: 5rpx;
}

.diy-category-product .product-list.column__1 .product-item {
	margin-bottom: 20rpx;
	background: #ffffff;
	width: 100%;
}

.diy-category-product .product-list.column__1 .product-item-box {
	display: flex;
	justify-content: flex-start;
	align-items: stretch;
}

.diy-category-product .product-list .product-cover image {
	width: 100%;
	height: 100%;
}

.diy-category-product .product-list.column__1 .product-cover {
	width: 240rpx;
	height: 240rpx;
	border-radius: 20rpx;
	overflow: hidden;
}

.diy-category-product .product-list.column__1 .product-info {
	margin: 20rpx 20rpx 20rpx 30rpx;
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}

.diy-category-product .product-list .product-info .already-sale text {
	padding: 4rpx 8rpx;
	border-radius: 8rpx;
	background: #f2f2f7;
	color: #999;
}

.diy-category-product .product-list .product-title {
	display: -webkit-box;
	font-size: 32rpx;
	overflow: hidden;
	word-wrap: break-word;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.diy-category-product .product-list.column__1 .product-title {
	max-height: 80rpx;
	line-height: 40rpx;
}

.diy-category-product .product-list.column__1 .selling-point {
	display: -webkit-box;
	overflow: hidden;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	line-height: 30rpx;
	max-height: 60rpx;
}

.diy-category-product .product-list.column__1 .already-sale {
	margin-top: 10rpx;
}

.diy-category-product .product-list.column__2 .product-title {
	height: 80rpx;
	line-height: 40rpx;
	margin-top: 20rpx;
	font-size: 26rpx;
	margin-bottom: 20rpx;
}

.diy-category-product .product-list.column__3 .product-title {
	margin-top: 20rpx;
	margin-left: 10rpx;
	margin-right: 10rpx;
	height: 72rpx;
	line-height: 36rpx;
	font-size: 30rpx;
}

.diy-category-product .product-list.column__2 .product-info {
	padding: 0 24rpx;
}

.diy-category-product .product-list .price {
	font-size: 34rpx;
}

.diy-category-product .product-list.column__2 .price {
	margin-top: 10rpx;
	font-size: 30rpx;
}

.diy-category-product .product-list.column__3 .price {
	margin-top: 10rpx;
	padding: 0 10rpx;
	font-size: 28rpx;
}

.diy-category-product .product-list.column__3 .price .text-d-line {
	font-size: 22rpx;
}

.diy-category-product .product-list.column__2,
.diy-category-product .product-list.column__3 {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-start;
	align-items: flex-start;
}

.diy-category-product .column__2 .product-item {
	width: 345rpx;
	margin-right: 20rpx;
	margin-bottom: 20rpx;
	padding-bottom: 20rpx;
	overflow: hidden;
	background: #ffffff;
	box-shadow: 0px 8rpx 3rpx 0px rgba(6, 0, 1, 0.03);
	border-radius: 12rpx;
}

.diy-category-product .display__list .column__2 .product-item:nth-child(2n + 0) {
	margin-right: 0;
}

.diy-category-product .column__2 .product-cover {
	width: 100%;
	height: 260rpx;
	border-radius: 12rpx 12rpx 0 0;
	/* margin: 20rpx auto; */
	overflow: hidden;
}

.diy-category-product .column__3 .product-item {
	width: 230rpx;
	margin-bottom: 10rpx;
	margin-right: 10rpx;
	padding-bottom: 10rpx;
	border-radius: 8rpx;
	overflow: hidden;
	background: #ffffff;
	box-shadow: 0 0 8rpx rgba(0, 0, 0, 0.1);
}

.diy-category-product .display__list .column__3 .product-item:nth-child(3n + 0) {
	margin-right: 0;
}

.diy-category-product .column__3 .product-cover {
	width: 100%;
	height: 230rpx;
	overflow: hidden;
}

.diy-category-product .display__slide .product-list {
	flex-wrap: nowrap;
}

.diy-category-product .display__slide .column__2 .product-item {
	width: 300rpx;
}

.diy-category-product .display__slide .column__3 .product-item {
	width: 200rpx;
}
</style>
